package Zuoye1;

import teater.Overload;

public class Zuoye3 {
    public int abs(int a){
        int t;
        if (a > 0) {
            t=a;
        }else{
            t=-a;
        }
        return t;
    }
    public float abs(float a){
        float t;
        if (a > 0) {
            t=a;
        }else{
            t=-a;
        }
        return t;
    }
    public double abs(double a){
        double t;
        if (a > 0) {
            t=a;
        }else{
            t=-a;
        }
        return t;
    }

    public static void main(String[] args) {
        Zuoye3 overload=new Zuoye3();
        System.out.println(overload.abs(-10));
        System.out.println(overload.abs(-14L));
        System.out.println(overload.abs(-20D));
    }
    //利用方法重载，编写三个重载方法，分别求出int类型绝对值，float类型绝对值和double类型绝对值。
}
